"""
DeepSeek 模型客户端工具
"""

from autogen_ext.models.openai import OpenAIChatCompletionClient
from autogen_core.models import ModelInfo
from typing import Optional


def create_deepseek_client(api_key: str, base_url: str = "https://api.deepseek.com") -> OpenAIChatCompletionClient:
    """
    创建 DeepSeek 模型客户端

    Args:
        api_key: DeepSeek API 密钥
        base_url: API 基础 URL

    Returns:
        配置好的 OpenAIChatCompletionClient 实例
    """

    # 创建 DeepSeek 模型信息
    deepseek_model_info = ModelInfo(
        family="openai",
        name="deepseek-chat",
        vision=False,
        function_calling=True,
        json_output=True,
        structured_output=True
    )

    # 创建并返回客户端
    return OpenAIChatCompletionClient(
        model="deepseek-chat",
        api_key=api_key,
        base_url=base_url,
        model_info=deepseek_model_info
    )